"""
def text_a():
    num = 10 #内部局部变量
    print(num)
text_a()

num = 200
def text_b():
    print(f"text_b:{num}")
text_b()
text_a()

#在函数内部可以修改全局变量吗
#定义一个全局变量
teacher = 1500
def text_1():
    print(f"text_1:{teacher}")
def text_2():
    teacher = 15
    print(f"text_2:{teacher}")
text_1()
text_2()
text_1()
print(teacher)
"""
#golbal关键字，用这个关键字在函数内部声明的变量就变成全局变量了
num = 200
def text_1():
    print(f"text_1:{num}")
def text_2():
    global num
    num = 2000
    print(f"text_2:{num}")
text_1()
text_2()
print(num)